﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using Teigha.Core;

namespace Teigha.TD
{
	public class OdDbSubDMesh : OdDbEntity
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdDbSubDMesh(IntPtr cPtr, bool cMemoryOwn) : base(TD_DbPINVOKE.OdDbSubDMesh_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdDbSubDMesh obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdDbSubDMesh()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							TD_DbPINVOKE.delete_OdDbSubDMesh(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public new static OdDbSubDMesh cast(OdRxObject pObj)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbSubDMesh_cast(OdRxObject.getCPtr(pObj));
			OdDbSubDMesh result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbSubDMesh)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbSubDMesh)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbSubDMesh)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdRxClass desc()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbSubDMesh_desc(), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxClass isA()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbSubDMesh_isA(this.swigCPtr), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxObject queryX(OdRxClass protocolClass)
		{
			OdRxObject result = Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbSubDMesh_queryX(this.swigCPtr, OdRxClass.getCPtr(protocolClass)), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdDbSubDMesh createObject()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbSubDMesh_createObject();
			OdDbSubDMesh result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbSubDMesh)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbSubDMesh)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbSubDMesh)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual bool subWorldDraw(OdGiWorldDraw pWd)
		{
			bool result = TD_DbPINVOKE.OdDbSubDMesh_subWorldDraw(this.swigCPtr, OdGiWorldDraw.getCPtr(pWd));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual uint subSetAttributes(OdGiDrawableTraits pTraits)
		{
			uint result = TD_DbPINVOKE.OdDbSubDMesh_subSetAttributes(this.swigCPtr, OdGiDrawableTraits.getCPtr(pTraits));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdDbObject decomposeForSave(DwgVersion ver, OdDbObjectId replaceId, out bool exchangeXData)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbSubDMesh_decomposeForSave(this.swigCPtr, (int)ver, OdDbObjectId.getCPtr(replaceId), out exchangeXData);
			OdDbObject result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbObject)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbObject)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbObject)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult dwgInFields(OdDbDwgFiler pFiler)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_dwgInFields(this.swigCPtr, OdDbDwgFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void dwgOutFields(OdDbDwgFiler pFiler)
		{
			TD_DbPINVOKE.OdDbSubDMesh_dwgOutFields(this.swigCPtr, OdDbDwgFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual OdResult dxfInFields(OdDbDxfFiler pFiler)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_dxfInFields(this.swigCPtr, OdDbDxfFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void dxfOutFields(OdDbDxfFiler pFiler)
		{
			TD_DbPINVOKE.OdDbSubDMesh_dxfOutFields(this.swigCPtr, OdDbDxfFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual OdResult subTransformBy(OdGeMatrix3d xfm)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_subTransformBy(this.swigCPtr, OdGeMatrix3d.getCPtr(xfm));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult subGetGeomExtents(OdGeExtents3d extents)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_subGetGeomExtents(this.swigCPtr, OdGeExtents3d.getCPtr(extents));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult subExplode(OdRxObjectPtrArray entitySet)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_subExplode(this.swigCPtr, OdRxObjectPtrArray.getCPtr(entitySet));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult setSubDMesh(OdGePoint3dArray vertexArray, OdInt32Array faceArray, int subDLevel)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_setSubDMesh(this.swigCPtr, OdGePoint3dArray.getCPtr(vertexArray), OdInt32Array.getCPtr(faceArray).Handle, subDLevel);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult setSphere(double radius, int divAxis, int divHeight, int subDLevel)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_setSphere(this.swigCPtr, radius, divAxis, divHeight, subDLevel);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult setCylinder(double majorRadius, double minorRadius, double height, int divAxis, int divHeight, int divCap, int subDLevel)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_setCylinder(this.swigCPtr, majorRadius, minorRadius, height, divAxis, divHeight, divCap, subDLevel);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult setCone(double majorRadius, double minorRadius, double height, int divAxis, int divHeight, int divCap, double radiusRatio, int subDLevel)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_setCone(this.swigCPtr, majorRadius, minorRadius, height, divAxis, divHeight, divCap, radiusRatio, subDLevel);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult setTorus(double majorRadius, int divSection, int divSweepPath, double sectionRadiusRatio, double sectionRotate, int subDLevel)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_setTorus(this.swigCPtr, majorRadius, divSection, divSweepPath, sectionRadiusRatio, sectionRotate, subDLevel);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult setBox(double xLen, double yLen, double zLen, int divX, int divY, int divZ, int subDLevel)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_setBox(this.swigCPtr, xLen, yLen, zLen, divX, divY, divZ, subDLevel);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult setWedge(double xLen, double yLen, double zLen, int divLength, int divWidth, int divHeight, int divSlope, int divCap, int subDLevel)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_setWedge(this.swigCPtr, xLen, yLen, zLen, divLength, divWidth, divHeight, divSlope, divCap, subDLevel);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult setPyramid(double radius, double height, int divLength, int divHeight, int divCap, int nSides, double radiusRatio, int subDLevel)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_setPyramid(this.swigCPtr, radius, height, divLength, divHeight, divCap, nSides, radiusRatio, subDLevel);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult subdDivideUp()
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_subdDivideUp(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult subdDivideDown()
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_subdDivideDown(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult subdRefine()
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_subdRefine__SWIG_0(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult subdRefine(OdDbFullSubentPathArray subentPaths)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_subdRefine__SWIG_1(this.swigCPtr, OdDbFullSubentPathArray.getCPtr(subentPaths));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult subdLevel(out int result)
		{
			OdResult result2 = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_subdLevel(this.swigCPtr, out result);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result2;
		}

		public OdResult splitFace(OdDbSubentId subentFaceId, OdDbSubentId subent0, OdGePoint3d point0, OdDbSubentId subent1, OdGePoint3d point1)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_splitFace(this.swigCPtr, OdDbSubentId.getCPtr(subentFaceId), OdDbSubentId.getCPtr(subent0), OdGePoint3d.getCPtr(point0), OdDbSubentId.getCPtr(subent1), OdGePoint3d.getCPtr(point1));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult extrudeFaces(OdDbFullSubentPathArray subentPaths, double length, OdGeVector3d dir, double taper)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_extrudeFaces__SWIG_0(this.swigCPtr, OdDbFullSubentPathArray.getCPtr(subentPaths), length, OdGeVector3d.getCPtr(dir), taper);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult extrudeFaces(OdDbFullSubentPathArray subentPaths, OdGePoint3dArray alongPath, double taper)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_extrudeFaces__SWIG_1(this.swigCPtr, OdDbFullSubentPathArray.getCPtr(subentPaths), OdGePoint3dArray.getCPtr(alongPath), taper);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult isWatertight(out bool result)
		{
			OdResult result2 = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_isWatertight(this.swigCPtr, out result);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result2;
		}

		public OdResult numOfFaces(out int result)
		{
			OdResult result2 = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_numOfFaces(this.swigCPtr, out result);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result2;
		}

		public OdResult numOfSubDividedFaces(out int result)
		{
			OdResult result2 = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_numOfSubDividedFaces(this.swigCPtr, out result);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result2;
		}

		public OdResult numOfSubDividedFacesAt(OdDbFullSubentPathArray subentPaths, out int result)
		{
			OdResult result2 = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_numOfSubDividedFacesAt(this.swigCPtr, OdDbFullSubentPathArray.getCPtr(subentPaths), out result);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result2;
		}

		public OdResult numOfVertices(out int result)
		{
			OdResult result2 = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_numOfVertices(this.swigCPtr, out result);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result2;
		}

		public OdResult numOfSubDividedVertices(out int result)
		{
			OdResult result2 = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_numOfSubDividedVertices(this.swigCPtr, out result);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result2;
		}

		public OdResult numOfEdges(out int result)
		{
			OdResult result2 = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_numOfEdges(this.swigCPtr, out result);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result2;
		}

		public OdResult getVertices(OdGePoint3dArray vertexArray)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_getVertices(this.swigCPtr, OdGePoint3dArray.getCPtr(vertexArray));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult getEdgeArray(OdInt32Array edgeArray)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_getEdgeArray(this.swigCPtr, OdInt32Array.getCPtr(edgeArray).Handle);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult getFaceArray(OdInt32Array faceArray)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_getFaceArray(this.swigCPtr, OdInt32Array.getCPtr(faceArray).Handle);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult getNormalArray(OdGeVector3dArray normalArray)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_getNormalArray(this.swigCPtr, OdGeVector3dArray.getCPtr(normalArray));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult getSubDividedVertices(OdGePoint3dArray vertexArray)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_getSubDividedVertices(this.swigCPtr, OdGePoint3dArray.getCPtr(vertexArray));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult getSubDividedFaceArray(OdInt32Array faceArray)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_getSubDividedFaceArray(this.swigCPtr, OdInt32Array.getCPtr(faceArray).Handle);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult getSubDividedNormalArray(OdGeVector3dArray normalArray)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_getSubDividedNormalArray(this.swigCPtr, OdGeVector3dArray.getCPtr(normalArray));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult getVertexAt(int nIndex, OdGePoint3d vertex)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_getVertexAt__SWIG_0(this.swigCPtr, nIndex, OdGePoint3d.getCPtr(vertex));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult setVertexAt(int nIndex, OdGePoint3d vertex)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_setVertexAt__SWIG_0(this.swigCPtr, nIndex, OdGePoint3d.getCPtr(vertex));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult getVertexAt(OdDbSubentId id, OdGePoint3d vertex)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_getVertexAt__SWIG_1(this.swigCPtr, OdDbSubentId.getCPtr(id), OdGePoint3d.getCPtr(vertex));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult setVertexAt(OdDbSubentId id, OdGePoint3d vertex)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_setVertexAt__SWIG_1(this.swigCPtr, OdDbSubentId.getCPtr(id), OdGePoint3d.getCPtr(vertex));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult getSubDividedVertexAt(int nIndex, OdGePoint3d vertex)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_getSubDividedVertexAt__SWIG_0(this.swigCPtr, nIndex, OdGePoint3d.getCPtr(vertex));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult getSubDividedVertexAt(OdDbSubentId id, OdGePoint3d vertex)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_getSubDividedVertexAt__SWIG_1(this.swigCPtr, OdDbSubentId.getCPtr(id), OdGePoint3d.getCPtr(vertex));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult setCrease(double creaseVal)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_setCrease__SWIG_0(this.swigCPtr, creaseVal);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult setCrease(OdDbFullSubentPathArray subentPaths, double creaseVal)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_setCrease__SWIG_1(this.swigCPtr, OdDbFullSubentPathArray.getCPtr(subentPaths), creaseVal);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult getCrease(OdDbFullSubentPathArray subentPaths, OdGeDoubleArray result)
		{
			OdResult result2 = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_getCrease__SWIG_0(this.swigCPtr, OdDbFullSubentPathArray.getCPtr(subentPaths), OdGeDoubleArray.getCPtr(result));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result2;
		}

		public OdResult getCrease(OdDbSubentId id, out double result)
		{
			OdResult result2 = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_getCrease__SWIG_1(this.swigCPtr, OdDbSubentId.getCPtr(id), out result);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result2;
		}

		public OdResult getAdjacentSubentPath(OdDbFullSubentPath path, SubentType type, OdDbFullSubentPathArray subentPaths)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_getAdjacentSubentPath(this.swigCPtr, OdDbFullSubentPath.getCPtr(path), (int)type, OdDbFullSubentPathArray.getCPtr(subentPaths));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult getSubentPath(int nIndex, SubentType type, OdDbFullSubentPathArray subentPaths)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_getSubentPath(this.swigCPtr, nIndex, (int)type, OdDbFullSubentPathArray.getCPtr(subentPaths));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult convertToSurface(bool bConvertAsSmooth, OdDbSubentId id, out OdDbSurface pSurface)
		{
			IntPtr zero = IntPtr.Zero;
			OdResult result;
			try
			{
				OdResult odResult = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_convertToSurface__SWIG_0(this.swigCPtr, bConvertAsSmooth, OdDbSubentId.getCPtr(id), out zero);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				result = odResult;
			}
			finally
			{
				pSurface = (OdDbSurface)Teigha.Core.Helpers.odrxCreateObjectInternal(zero, true);
			}
			return result;
		}

		public OdResult convertToSurface(bool bConvertAsSmooth, bool optimize, out OdDbSurface pSurface)
		{
			IntPtr zero = IntPtr.Zero;
			OdResult result;
			try
			{
				OdResult odResult = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_convertToSurface__SWIG_1(this.swigCPtr, bConvertAsSmooth, optimize, out zero);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				result = odResult;
			}
			finally
			{
				pSurface = (OdDbSurface)Teigha.Core.Helpers.odrxCreateObjectInternal(zero, true);
			}
			return result;
		}

		public OdResult convertToSolid(bool bConvertAsSmooth, bool optimize, out OdDb3dSolid pSolid)
		{
			IntPtr zero = IntPtr.Zero;
			OdResult result;
			try
			{
				OdResult odResult = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_convertToSolid(this.swigCPtr, bConvertAsSmooth, optimize, out zero);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				result = odResult;
			}
			finally
			{
				pSolid = (OdDb3dSolid)Teigha.Core.Helpers.odrxCreateObjectInternal(zero, true);
			}
			return result;
		}

		public OdResult getSubentColor(OdDbSubentId id, OdCmColor color)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_getSubentColor(this.swigCPtr, OdDbSubentId.getCPtr(id), OdCmColor.getCPtr(color));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult setSubentColor(OdDbSubentId id, OdCmColor color)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_setSubentColor(this.swigCPtr, OdDbSubentId.getCPtr(id), OdCmColor.getCPtr(color));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult getSubentMaterial(OdDbSubentId id, OdDbObjectId material)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_getSubentMaterial(this.swigCPtr, OdDbSubentId.getCPtr(id), OdDbObjectId.getCPtr(material));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult setSubentMaterial(OdDbSubentId id, OdDbObjectId material)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_setSubentMaterial(this.swigCPtr, OdDbSubentId.getCPtr(id), OdDbObjectId.getCPtr(material));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult getSubentMaterialMapper(OdDbSubentId id, OdGiMapper mapper)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_getSubentMaterialMapper(this.swigCPtr, OdDbSubentId.getCPtr(id), OdGiMapper.getCPtr(mapper));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult setSubentMaterialMapper(OdDbSubentId id, OdGiMapper mapper)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_setSubentMaterialMapper(this.swigCPtr, OdDbSubentId.getCPtr(id), OdGiMapper.getCPtr(mapper));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult getFacePlane(OdDbSubentId id, OdGePlane facePlane)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_getFacePlane(this.swigCPtr, OdDbSubentId.getCPtr(id), OdGePlane.getCPtr(facePlane));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult computeVolume(out double retVolume)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_computeVolume(this.swigCPtr, out retVolume);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult computeSurfaceArea(out double retSurfArea)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_computeSurfaceArea(this.swigCPtr, out retSurfArea);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult getVertexNormalArray(OdGeVector3dArray arrNorm)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_getVertexNormalArray(this.swigCPtr, OdGeVector3dArray.getCPtr(arrNorm));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult getVertexTextureArray(OdGePoint3dArray arrPts)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_getVertexTextureArray(this.swigCPtr, OdGePoint3dArray.getCPtr(arrPts));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult getVertexColorArray(OdCmEntityColorArray arrColor)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_getVertexColorArray(this.swigCPtr, OdCmEntityColorArray.getCPtr(arrColor));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult setVertexNormalArray(OdGeVector3dArray arrNorm)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_setVertexNormalArray(this.swigCPtr, OdGeVector3dArray.getCPtr(arrNorm));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult setVertexTextureArray(OdGePoint3dArray arrPts)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_setVertexTextureArray(this.swigCPtr, OdGePoint3dArray.getCPtr(arrPts));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult setVertexColorArray(OdCmEntityColorArray arrColor)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_setVertexColorArray(this.swigCPtr, OdCmEntityColorArray.getCPtr(arrColor));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult subGetSubentPathsAtGsMarker(SubentType type, IntPtr gsMark, OdGePoint3d arg2, OdGeMatrix3d arg3, OdDbFullSubentPathArray subentPaths, OdDbObjectIdArray pEntAndInsertStack)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_subGetSubentPathsAtGsMarker(this.swigCPtr, (int)type, gsMark, OdGePoint3d.getCPtr(arg2), OdGeMatrix3d.getCPtr(arg3), OdDbFullSubentPathArray.getCPtr(subentPaths), OdDbObjectIdArray.getCPtr(pEntAndInsertStack));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult subGetGsMarkersAtSubentPath(OdDbFullSubentPath subPath, SWIGTYPE_p_OdGsMarkerArray gsMarkers)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbSubDMesh_subGetGsMarkersAtSubentPath(this.swigCPtr, OdDbFullSubentPath.getCPtr(subPath), SWIGTYPE_p_OdGsMarkerArray.getCPtr(gsMarkers));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
